import http from '@/utils/http';
import {baseUrl} from './commonApi'

const paths = {
    getMessageBoard: `${baseUrl}/message-board`,
    getMessageDetail: `${baseUrl}/message-board/{id}`,
    askQuestion: `${baseUrl}/message-board`,
};
/**
 * 获取留言板
 * @param {} data 
 * @param {*} callback 
 * @returns 
 */
export function getMessageBoard(data, callback) {
    return http.get(paths.getMessageBoard, { data}, callback)
}
/**
 * 获取留言板详情
 * @param {*} data 
 * @param {*} callback 
 * @returns 
 */
export function getMessageDetail(id, callback) {
    var tPath = paths.getMessageDetail.replace('{id}', id);
    return http.get(tPath,null, callback)
}
/**
 * 发表留言
 * @param {*} data 
 * @param {*} callback 
 * @returns 
 */
 export function askQuestion(data, callback) {
    return http.post(paths.askQuestion,{data}, callback)
}